home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / network / lattice / dulib.lzh / DU_LIB / STG_HELP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-10  |  1.3 KB  |  68 lines

  1. /*
  2.   DU_LIB v2
  3.   Gem Window Management & Dialog Library For Lattice C
  4.   ©1994,95, by Craig Graham.
  5.   
  6.   Based on the DU_LIBv1 Library for HiSoft Basic.
  7. */
  8.  
  9. /*
  10.     ST-Guide Hypertext Help Support
  11. */
  12.  
  13. #include <AV_PROT.H>
  14. #include "DULIB.H"
  15.  
  16. char application_helpfile[FMSIZE];
  17.  
  18. void Set_application_helpfile(char *h)
  19. {
  20.     sprintf(application_helpfile, "%s", h);
  21.     Set_key_callback(0x6200, &dialog_help);
  22. }
  23.  
  24. void Set_dialog_help_topic(short dialog, char *h)
  25. {
  26.     strncpy(dialog_details[dialog].help_topic,h,29);
  27. }
  28.  
  29. char av_message[FMSIZE];
  30.  
  31. /*
  32.     Response to a help keypress in a dialog with it's help property active
  33. */
  34. short dialog_help(void)
  35. {
  36.     struct av_msg {
  37.         short cmd;
  38.         short apid;
  39.         short j1;
  40.         char *path;
  41.         char *command_line;
  42.         short j2;
  43.     } buf;
  44.     short stg_apid;
  45.     short wh,d;
  46.  
  47.     wind_get(cr_wind_handle,WF_TOP,&wh,&d,&d,&d);
  48.     if ((WF_TOP)&&(windows[wh].window_type!=wt_null))
  49.     {
  50.         d=windows[wh].the_dialog;
  51.         sprintf(av_message,"*:\\%s %s",application_helpfile,dialog_details[d].help_topic);
  52.     }else{
  53.         sprintf(av_message,"*:\\%s",application_helpfile);
  54.     }
  55.  
  56.     stg_apid=appl_find("ST-GUIDE");
  57.  
  58.     buf.cmd=VA_START;
  59.     buf.apid=AESid;
  60.     buf.j1=buf.j2=0;
  61.     buf.path=av_message;
  62.     buf.command_line=NULL;
  63.  
  64.     appl_write(stg_apid,16,&buf);
  65.     
  66.     return TRUE;
  67. }
  68.